1. Field of the Invention
The present invention relates to an exclusive-use (lock) control system that performs an exclusive-use (lock) control of resources in a computer system.
2. Description of the Related Art
Recently, there has been considerable activity in research and development directed toward improving the processing ability of the hardware system of a data processing device. For example, a tightly-connected multiprocessor (MP) system made up of eight CPUs (processors) has been proposed in order to improve the processing ability of the hardware system. As the processing ability of the hardware system is improved, a loss due to a collision between accesses to a resource commonly and serially used in the system increases in proportion to the number of CPUs (Central Processing Units). In order to eliminate the above problem, it is necessary to classify a serializing process into parts with respect to the common resource serially used among the CPUs and to reduce collisions among the CPUs as much as possible. However, all execution units in the system cannot cope with the classification of the common resource at one time. Accordingly, there are execution units necessary to serially use the common resource in the overall system. There is a requirement in which the common resource should be serially used in a state in which an execution unit that uses the common resource as a classified resource, and an execution unit that uses the common resource as a non-classified resource are mixed. Hence, it is desired that the common resource be classified under the condition in which requests for the serializing process are ensured.
Conventionally, a lock service is known for making it possible for various types of resources to be serially accessed. In the serializing process in the lock service, each CPU attempts to write a CPU identifier into an area (lock control area) to indicate acquirement of a lock by using a serializing instruction (for example, a compare and swap (CS) instruction) by hardware. A CPU which has successfully written the CPU identifier into the lock control area can exclusively own a common resource.
The lock service provides the following two types of locks regarding classification: a class lock and a non-class lock. The class lock is a classified lock based on an application. There are lock control areas for respective classes, and the lock can be acquired for each of the classes. The non-class lock is a non-classified lock, and there is a single lock control area as a whole. The lock for the whole resource can be acquired.
However, according to the conventional lock service, it is impossible to give a resource both a class lock and a non-class lock. That is, when a resource is classified, all execution units utilizing the resource in the system must correspond to the classification. Hence, execution units corresponding to the classification and execution units needing the serializing process in the whole system cannot coexist. Hence, it is impossible to satisfy a requirement in which an execution unit wishes to perform the serializing process for a resource by the class lock and another execution unit wishes to perform the serializing process for the above resource by the non-class lock. In such a case, the serializing process for the resource can be performed only by the non-class lock. Hence, a collision among CPUs may occur in the serializing process.